package cn.cloud9.provider.controller;

import cn.cloud9.provider.pojo.Product;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.math.BigDecimal;
import java.util.Arrays;
import java.util.List;

@RestController
@RequestMapping("/product")
public class ProductController {


    /**
     * localhost:8081/product/all-list
     * @return
     */
    @RequestMapping("/all-list")
    public List<Product> getAllProductList() {
        return Arrays.asList(
            new Product( "proc-1001", "name-1001", "no-1001", new BigDecimal(101)),
            new Product( "proc-1002", "name-1002", "no-1002", new BigDecimal(102)),
            new Product( "proc-1003", "name-1003", "no-1003", new BigDecimal(103)),
            new Product( "proc-1004", "name-1004", "no-1004", new BigDecimal(104)),
            new Product( "proc-1005", "name-1005", "no-1005", new BigDecimal(105))
        );
    }
}
